package nthu.web.model.domain;

import java.io.Serializable;

import nthu.web.model.domain.define.GroupInterface;

@SuppressWarnings("serial")
public class Group implements GroupInterface,Serializable {

	private Long id;
    private String name;
    private String description;
    private User[] administrator;
    private User[] member;
    private Location[] locations;  //譬如7-11可以管理旗下的上百家門市(Location)

    public Group(String name){
       this.name = name;
    }

    public Long getID(){
       return this.id;
    }

    public void setGroupName(String name){
       this.name = name;
    }
    public String getGroupName(){
       return this.name;
    }

    public void setDescription(String description){
       this.description = description;
    }
    public String getDescription(){
       return this.description;
    }


    public void addAdministrator(User[] user){

    }
    public void removeAdministrator(User[] user){

    }

    /* Returns true if the User has group administrator permissions.
       Group administrators are also considered to be members. */
	public boolean isAdministrator(User user){

        return true;
    }
    public int getAdministratorCount(){
        int count = 0;
          //compute
        return count;
    }

    public void addMember(User[] user){

    }
    public void removeMember(User[] user){

    }

    /* Returns true if the User is a member of the group. */
    public boolean isMember(User user){
        return true;
    }
    public int getMemberCount(){
        int count = 0;
          //compute
        return count;
    }


}
